// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.

//Vue全家桶指的是创建SPA(单页应用)的技术栈
//Vue+Vue-router+Vuex+axios+(vue-lazyload)
//vue.js
//页面跳转路由Vue-router
//兄弟之间的状态管理Vuex
//官方推荐工具 axios(ajax 请求数据) VueLazyload(优化图片懒加载)


import Vue from 'vue'
import App from './App'
import router from './router'
import $ from 'jquery'
import axios from 'axios'
import store from '@/store/store';
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import VueResource from 'vue-resource'
Vue.use(VueResource)
Vue.use(MintUI)

Vue.config.productionTip = false


//数据接口
const baseURL ="https://www.easy-mock.com/mock/5acdc80276ec7245e1cf94b5/ljw";
axios.interceptors.request.use(function(config){
	config.baseURL = baseURL
	//	console.log(config)	
	return config;
})

//rem
function rem(){
	var deviceWidth = document.documentElement.clientWidth;//设备css像素宽
	var dpr,scale,fontSize;
    dpr = 2;
    scale = 1/dpr;
    fontSize = deviceWidth/2;  
    window.document.documentElement.style.fontSize = fontSize + 'px';
//	document.querySelector('meta[name="viewport"]').setAttribute('content','initial-scale=' + scale + ', maximum-scale=' + scale + ', minimum-scale=' + scale + ', user-scalable=no');
	var docEl = window.document.documentElement;
//	docEl.setAttribute('data-dpr', dpr);
}rem()

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
